// 环境类型定义
export type AppEnv = 'development' | 'test' | 'pre' | 'production';

// 环境变量接口
export interface ImportMetaEnv {
  readonly VITE_APP_ENV: AppEnv;
  readonly VITE_APP_TITLE: string;
  readonly VITE_API_BASE_URL: string;
  readonly VITE_API_TIMEOUT: string;
  readonly VITE_APP_VERSION: string;
  readonly VITE_APP_DEBUG: string;
  readonly VITE_APP_LOG_LEVEL: 'debug' | 'info' | 'warn' | 'error';
  readonly VITE_FEATURE_ANALYTICS: string;
  readonly VITE_FEATURE_MOCK_API: string;
  readonly VITE_FEATURE_DEVTOOLS: string;
  readonly VITE_GOOGLE_ANALYTICS_ID: string;
  readonly VITE_SENTRY_DSN: string;
}

declare global {
  interface ImportMeta {
    readonly env: ImportMetaEnv;
  }
}

// 环境配置接口
export interface EnvConfig {
  env: AppEnv;
  isDevelopment: boolean;
  isTest: boolean;
  isPre: boolean;
  isProduction: boolean;
  apiBaseUrl: string;
  apiTimeout: number;
  appTitle: string;
  appVersion: string;
  debug: boolean;
  logLevel: 'debug' | 'info' | 'warn' | 'error';
  features: {
    analytics: boolean;
    mockApi: boolean;
    devtools: boolean;
  };
  services: {
    googleAnalyticsId: string;
    sentryDsn: string;
  };
}
